package org.goldfish.chatroom.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/error")
public class ErrorHandleController {
    @GetMapping
    public String error(
            Model model,
            @RequestParam(
                    name = "sms_prompt",
                    defaultValue = "Unknown error, probably malformed request"
            )
            String error
    ) {
        model.addAttribute("error", error);
        return "error";
    }
}
